package com.fight.strive.sys.modules.rbac.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.fight.strive.sys.modules.rbac.dto.RbacUserDepartmentDto;
import com.fight.strive.sys.modules.rbac.entity.RbacUserDepartmentEntity;

import java.util.List;

public interface RbacUserDepartmentService extends IService<RbacUserDepartmentEntity> {

    /**
     * 保存人员部门关联信息
     *
     * @param entity entity
     */
    void saveUserDepartment(RbacUserDepartmentEntity entity);

    /**
     * 根据部门ID查询
     *
     * @param departmentId department id
     * @return list
     */
    List<RbacUserDepartmentEntity> listByDepartmentId(Long departmentId);

    /**
     * 根据部门 ID 查询 用户 ID
     *
     * @param departmentId 部门 ID
     * @return user id list
     */
    List<Long> listUserIdByDepartmentId(Long departmentId);

    /**
     * 根据用户ID查询
     *
     * @param userId user id
     * @return list
     */
    List<RbacUserDepartmentEntity> listByUserId(Long userId);

    /**
     * 根据用户ID查询，部门信息及用户部门关联信息
     *
     * @param userId user id
     * @return list
     */
    List<RbacUserDepartmentDto> listDtoByUserId(Long userId);

    /**
     * 根据 用户 ID 获取 部门 ID
     *
     * @param userId user id
     * @return dep id list
     */
    List<Long> listDepartmentIdByUserId(Long userId);

    /**
     * 根据部门ID删除
     *
     * @param departmentId department id
     */
    void removeByDepartmentId(Long departmentId);
}
